home *** CD-ROM | disk | FTP | other *** search
-
- #ifndef __CodeFragSearch__h__
- #define __CodeFragSearch__h__
-
- #include <CodeFragments.h>
-
- #ifdef __CFM68K__
- #pragma import on
- #endif
-
- // This file defines the Code Fragment Search functions.
- // At some point in the future, this file may be merged with CodeFragments.h
- // The functions declared in this file are defined and supplied along with SOM.
- // Link with the SOM Kernel shared library file to satisfy the linker.
- // The SOM "fat" shared library must be installed (in the extensions folder)
- // in order to use these search functions.
-
- // This is the 'cfrg' resource member extension template definition.
- // It is added to the end of the existing data in the cfrg entry.
- // Note that the end of the existing cfrg entry includes the
- // padding to bring it up to a longword boundary; this data
- // is layed out after the longword padding (if any).
- // The length in the memberSize field of the existing
- // entry accounts for this addition. This extension also
- // is aligned up to a longword boundary. The length specified
- // by memberSize includes all of: the length of the initial
- // cfrg entry as described in CodeFragmentTypes.r, which includes
- // padding to bring that part up to a longword boundary, the
- // length of the member extension (if present) and any padding
- // needed to bring the extension up to a longword boundary.
-
- #define kXTCFRGMagic 0x30ee
-
- typedef struct {
- unsigned short magic; // 0x30ee
- unsigned short exLength; // length of extension member
- OSType libraryKind; // see common types listed below
- unsigned char className [4]; // Packed Str255s start here:
- // Str255 className;
- // Str255 qualifier;
- // Str255 infoStr;
- // Str255 intlName;
- } XtCfrg, *XtCfrgPtr;
-
-
-
- // This is the CFM API search function return struct layout
-
- struct FragSearchItem {
- OSType archType; // processor architecture
- OSType libraryKind; // major library catagory
-
- // offset(s) are relative to stringBase at beginning of this block
- // ie: use (StringPtr) (stringbase + baseClassNameOffset)
-
- long baseClassNameOffset;// offset to base class name pstring
- long qualifierOffset; // offset to qualifier pstring
-
- long cfrgNameOffset; // name to give GetSharedLibrary to load library (pstring)
- long infoStrOffset; // extra info to help make decision (pstring)
-
- long intlNameOffset; // name to present to user in pop up choice list (pstring)
-
- short dummy2a; // padding
-
- short fileVRefNum; // the containing file's vRefNum
- long fileParID; // the containing file's dirID
- long fileIndex; // the file's directory entry valence #
-
- long cfrgMemberOffset; // offset from start of cfrg to start of cfrg member entry
-
- short dummy2b; // padding
-
- unsigned char cfrgUsage; // from cfrg usage field
- unsigned char cfrgWhere; // from cfrg where field
- long cfrgOffset; // from cfrg offset field
- long cfrgLength; // from cfrg length field
- unsigned long cfrgCurrentVersion; // from cfrg currentVersion field
- unsigned long cfrgOldDefVersion; // from cfrg oldDefVersion field
-
- long dummy4a; // reserved for future use by Apple.
- long dummy4b;
- long dummy4c;
- long dummy4d;
- };
-
- typedef struct FragSearchItem FragSearchItem, *FragSearchItemPtr;
-
-
- struct FragSearchBlk {
- unsigned char stringBase [2]; // "& stringBase [0]" is added to the offsets in
- // FragSearchItem to get to the pstrings...
- unsigned short count; // the number of "candidates" below
- long dummy4; // reserved for future use by Apple.
-
- FragSearchItem foundItems [1]; // array of retured values
- };
-
- typedef struct FragSearchBlk FragSearchBlk, *FragSearchPtr, **FragSearchHandle;
-
-
- // This OSType definitions define common values for libraryKind
- // The meaning of the baseClassName, qualifier, and returned infoStr
- // are based on the "libraryKind" selector. For both OpenDoc parts,
- // and SOM class libraries, the baseClassName parameter is a real
- // SOM class name, and the use of the qualifier is not mandated.
- // For component manager libraries, the baseClassName designates
- // the component type and the qualifier designates the sub-type.
- // the returned infoStr gives additional data.
-
- #define kFragAnyLibraryKind 0
- #define kFragDocumentPartHandler 'part' // OpenDoc(TM) part handler
- #define kFragClassLibrary 'clas' // general SOM(TM) class library
- #define kFragInterfaceDefinition 'libr' // traditional library
- #define kFragComponentMgrLibrary 'comp' // Component Manager component
-
-
- // FragFindInterfaces locates libraries that have extended cfrg entries.
- // It uses the currently active CFM search path to locate shared libraries.
- // Extended cfrg entries can be created/reported with the new version of MergeFragment
- // If any of the parameters in (archType,libraryKind,baseClassName,qualifier)
- // supplied is literally 0 (null or zero, but not the empty string "\p" or "")
- // then this indicates that a match of any value is desired.
- // Parameters are all case sensitive.
- // (This function will locate only libraries that have use an extended cfrg.)
- // NOTE: This function allocates memory in the current zone. It also performs a
- // CFM search operation which may result in searching the current library search path
- // for shared libraries.
- // Dispose of the results from FragFindInterfaces using FragDisposeSearchResults.
-
-
- pascal OSErr FragFindInterfaces ( OSType archType,
- OSType libraryKind,
- Str255 baseClassName,
- Str255 qualifier,
- FragSearchHandle *results );
-
-
- // This version takes an FSSpec and performs the same searching, but only on the one file.
- // (Note that the returned fileVRefNum, fileParID, and fileIndex members are not valid.)
- // Dispose of the results from FragFindInterfaces using FragDisposeSearchResults.
- pascal OSErr FragFindInterfacesInFile ( FSSpecPtr fileSpec,
- OSType archType,
- OSType libraryKind,
- Str255 baseClassName,
- Str255 qualifier,
- FragSearchHandle *searchHandlePtr );
-
- // This version takes a cfrg entry (pointer) and performs the same searching,
- // but only on the one cfrg entry.
- // Be sure to lock the cfrg if it comes from a resource.
- // (Note that the returned fileVRefNum, fileParID, and fileIndex members are not valid.)
- // Dispose of the results from FragFindInterfaces using FragDisposeSearchResults.
- pascal OSErr FragFindInterfacesInCfrg ( XtCfrgPtr cfrgPtr,
- OSType archType,
- OSType libraryKind,
- Str255 baseClassName,
- Str255 qualifier,
- FragSearchHandle *results );
-
-
- // Dispose of the results from FragFindInterfaces... using FragDisposeSearchResults.
- pascal void FragDisposeSearchResults ( FragSearchHandle results );
-
- #ifdef __CFM68K__
- #pragma import off
- #endif
-
- #endif
-